/**
 * 内容管理路由
 * 处理后台对命理内容的管理功能
 */

const express = require('express');
const router = express.Router();
const contentController = require('../controllers/content.controller');
const { authorize } = require('../middleware/permission.middleware');

/**
 * GET /admin/content/bazi
 * 获取八字内容配置列表
 */
router.get('/bazi', authorize(['superadmin', 'admin', 'editor']), contentController.getBaziContent);

/**
 * POST /admin/content/bazi
 * 创建八字内容配置
 */
router.post('/bazi', authorize(['superadmin', 'admin', 'editor']), contentController.createBaziContent);

/**
 * PUT /admin/content/bazi/:id
 * 更新八字内容配置
 */
router.put('/bazi/:id', authorize(['superadmin', 'admin', 'editor']), contentController.updateBaziContent);

/**
 * DELETE /admin/content/bazi/:id
 * 删除八字内容配置
 */
router.delete('/bazi/:id', authorize(['superadmin', 'admin']), contentController.deleteBaziContent);

/**
 * GET /admin/content/tarot
 * 获取塔罗内容配置列表
 */
router.get('/tarot', authorize(['superadmin', 'admin', 'editor']), contentController.getTarotContent);

/**
 * GET /admin/content/dreams
 * 获取解梦内容配置列表
 */
router.get('/dreams', authorize(['superadmin', 'admin', 'editor']), contentController.getDreamContent);

/**
 * POST /admin/content/dreams
 * 创建解梦内容配置
 */
router.post('/dreams', authorize(['superadmin', 'admin', 'editor']), contentController.createDreamContent);

/**
 * GET /admin/content/face
 * 获取面相内容配置列表
 */
router.get('/face', authorize(['superadmin', 'admin', 'editor']), contentController.getFaceContent);

/**
 * GET /admin/content/palm
 * 获取手相内容配置列表
 */
router.get('/palm', authorize(['superadmin', 'admin', 'editor']), contentController.getPalmContent);

/**
 * GET /admin/content/categories
 * 获取内容分类列表
 */
router.get('/categories', authorize(['superadmin', 'admin', 'editor']), contentController.getContentCategories);

module.exports = router;